Skip to content

Conversation

@iamgabrielma
Copy link
Contributor

Description

By updating the minimum release version to iOS 15 recently, we've seen some deprecation warnings. This PR fixes the case for 'windows' was deprecated in iOS 15.0: Use UIWindowScene.windows on a relevant window scene instead.

Changes

Rather than getting the first window through the UIApplication.windows shared instance, we get the window through its connected scenes, by filtering down the first one that is of type UIWindowScene. With this we still get the same behavior, and we remove the deprecation warning.

Testing instructions

I based my own testing on the cases of the original PR, in this case, as this pattern allows us to set custom safe areas for the focus window, we can test the Simple Payments flow with big fonts and on landscape and see that everything still looks correct.

Screenshots

Before After
Before After

@iamgabrielma iamgabrielma added type: enhancement A request for an enhancement. iOS 15 Specific to iOS 15 labels Nov 10, 2022
@iamgabrielma iamgabrielma added this to the 11.3 milestone Nov 10, 2022
@wpmobilebot
Copy link
Collaborator

You can test the changes from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr8077-3c50ecf on your iPhone

If you need access to App Center, please ask a maintainer to add you.

Copy link
Contributor

@Ecarrion Ecarrion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit more complex, but if it works it works! Thanks for handling this warning! 🙇

@iamgabrielma iamgabrielma merged commit 7e9e0d5 into trunk Nov 11, 2022
@iamgabrielma iamgabrielma deleted the task/window-deprecated-ios-15 branch November 11, 2022 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

iOS 15 Specific to iOS 15 type: enhancement A request for an enhancement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants